home *** CD-ROM | disk | FTP | other *** search
/ Micromanía: 150 Juegos 2010 / 150Juegos_16.iso / Shareware / Shape Smash / shape-smash.swf / scripts / Code / FIELD / effects / _xj355.as < prev   
Encoding:
Text File  |  2010-05-14  |  1.2 KB  |  48 lines

  1. package Code.FIELD.effects
  2. {
  3.    import Code.LIB._wy567;
  4.    import flash.events.Event;
  5.    
  6.    public class _xj355 extends _wy567
  7.    {
  8.       public static const stFly:int = 0;
  9.       
  10.       public static const stFlyAlpha:int = 1;
  11.       
  12.       private var state:int;
  13.       
  14.       private var step:int = 0;
  15.       
  16.       public function _xj355(param1:int, param2:int, param3:String = null, param4:Boolean = false)
  17.       {
  18.          step = 0;
  19.          super(param1,param2,param3,param4);
  20.          this.addEventListener(Event.ENTER_FRAME,onEnterFrame);
  21.          this.state = stFly;
  22.       }
  23.       
  24.       public function onEnterFrame(param1:Event) : void
  25.       {
  26.          switch(state)
  27.          {
  28.             case stFly:
  29.                this._vg471 -= 3;
  30.                if(++step >= 30)
  31.                {
  32.                   state = stFlyAlpha;
  33.                }
  34.                break;
  35.             case stFlyAlpha:
  36.                this.alpha -= 0.09;
  37.                this._vg471 -= 3;
  38.                if(alpha <= 0)
  39.                {
  40.                   removeEventListener(Event.ENTER_FRAME,onEnterFrame);
  41.                   parent.removeChild(this);
  42.                }
  43.          }
  44.       }
  45.    }
  46. }
  47.  
  48.